home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / stdarg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-05-20  |  786 b   |  36 lines

  1. /* Copyright (C) 1986-2001 by Digital Mars */
  2. /* www.digitalmars.com */
  3.  
  4. #if __SC__ || __RCC__
  5. #pragma once
  6. #endif
  7.  
  8. #ifndef __STDARG_H
  9. #define __STDARG_H 1
  10.  
  11. #if __INTSIZE == 4
  12. #define __VA_ALIGN    3
  13. #else
  14. #define __VA_ALIGN    1
  15. #endif
  16.  
  17. #define __va_size(type) ((sizeof(type) + __VA_ALIGN) & ~__VA_ALIGN)
  18. #define _INTSIZEOF(n)    ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
  19.  
  20. #if 1
  21. #define __SS
  22. #define _FARARG_
  23. #else
  24. #define __SS    __ss
  25. #define _FARARG_ __far
  26. #endif
  27.  
  28. typedef char __SS *va_list;
  29. #define va_start(ap,parmn) ((void)((ap) = (va_list)&(parmn)+__va_size(parmn)))
  30. #define va_arg(ap,type)       (*(type __SS *)(((ap)+=__va_size(type))-(__va_size(type))))
  31. #define va_end(ap)       ((void)0)
  32. #define va_copy(dest,src)  ((dest) = (src))
  33.  
  34. #endif
  35.  
  36.